<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/yitao.css"/>
		<link rel="stylesheet" type="text/css" href="css/offer.css"/>
	</head>
	<body>
		<div id="offer">
			<div id="offer_logo">
				<a  href="index.html">
					<img src="img/TB1yRiUQVXXXXaAXFXXXXXXXXXX-620-220.png" title="上一淘，能省会赚"/>
				</a>
				<div id="offer_msg">
					<p>为确保您账户的安全及正常使用，依《网络安全法》相关要求，6月1日起会员账户需绑定手机。如您还未绑定，请尽快完成，感谢您的理解及支持！</p>
				</div>
			</div>
		</div>
		<div id="yitao">
			<img src="img/TB1Pe8YcwMPMeJjy1XcXXXpppXa-2500-600.png"/>
			<div id="login-box-warp">
				<h2>登录</h2>
				<div id="username-field">
					<div id="label"></div>
					<input type="text" name="usernama" id="username" placeholder="会员名/邮箱/手机号 "/>
				</div>
				<div id="password-field">
					<div id="label_two"></div>
					<input type="password" name="password" id="password" placeholder="请输入密码 "/>
				</div>
			<button id="BUT"><p>登录</p></button>
			<div id="login-links">
				<a href="">忘记密码</a>
				<a href="">忘记用户名</a>
				<a href="register.html">免费注册</a>
			</div>
			</div>
		</div>
		<script src="js/myajax.js" charset="utf-8"></script>
		<script type="text/javascript">
			var oUsername=document.getElementById("username");
			var oPassword=document.querySelector("input[name=password]");
			var oBtn=document.getElementById("BUT");
			oBtn.onclick=function() {
				myajax.post("http://h6.duchengjiu.top/shop/api_user.php",
				{
					status:"login",
					username:oUsername.value,
					password:oPassword.value
				},function  (error,responseText) {
					var json=JSON.parse(responseText);
					console.log(json);
					localStorage.token=json.data.token;
					localStorage.username=json.data.username;
					console.log(localStorage.token);
					console.log(localStorage.username);
					if (localStorage.backurl) {
			          location.href = localStorage.backurl;
			        } else {
			          location.href = 'index.html';
			        }

				});
			}
		</script>
		
		
	</body>
</html>
